﻿using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;

namespace ConsoleApp1
{
    class MyCompare : IComparer
    {
        public int Compare(object a, object b)
        {
            //str1.CompareTo(str2) 从小到大排     str2.CompareTo(str1)从大到小排
            string str1 = a.ToString();
            string str2 = b.ToString();
            return str1.CompareTo(str2);
        }
    }
}
